package com.ruoyi.gcgl.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.gcgl.mapper.GysptPurchaseMapper;
import com.ruoyi.gcgl.domain.GysptPurchase;
import com.ruoyi.gcgl.service.IGysptPurchaseService;
import com.ruoyi.common.core.text.Convert;

/**
 * 采购单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-06
 */
@Service
public class GysptPurchaseServiceImpl implements IGysptPurchaseService 
{
    @Autowired
    private GysptPurchaseMapper gysptPurchaseMapper;

    /**
     * 查询采购单
     * 
     * @param id 采购单主键
     * @return 采购单
     */
    @Override
    public GysptPurchase selectGysptPurchaseById(Long id)
    {
        return gysptPurchaseMapper.selectGysptPurchaseById(id);
    }

    /**
     * 查询采购单列表
     * 
     * @param gysptPurchase 采购单
     * @return 采购单
     */
    @Override
    public List<GysptPurchase> selectGysptPurchaseList(GysptPurchase gysptPurchase)
    {
        return gysptPurchaseMapper.selectGysptPurchaseList(gysptPurchase);
    }

    /**
     * 新增采购单
     * 
     * @param gysptPurchase 采购单
     * @return 结果
     */
    @Override
    public int insertGysptPurchase(GysptPurchase gysptPurchase)
    {
        return gysptPurchaseMapper.insertGysptPurchase(gysptPurchase);
    }

    /**
     * 修改采购单
     * 
     * @param gysptPurchase 采购单
     * @return 结果
     */
    @Override
    public int updateGysptPurchase(GysptPurchase gysptPurchase)
    {
        return gysptPurchaseMapper.updateGysptPurchase(gysptPurchase);
    }

    /**
     * 批量删除采购单
     * 
     * @param ids 需要删除的采购单主键
     * @return 结果
     */
    @Override
    public int deleteGysptPurchaseByIds(String ids)
    {
        return gysptPurchaseMapper.deleteGysptPurchaseByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除采购单信息
     * 
     * @param id 采购单主键
     * @return 结果
     */
    @Override
    public int deleteGysptPurchaseById(Long id)
    {
        return gysptPurchaseMapper.deleteGysptPurchaseById(id);
    }
}
